package com.outsource.framework.model.services.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.outsource.framework.domain.Tyonghu;
import com.outsource.framework.model.repository.TyonghuRepository;
import com.outsource.framework.model.services.TyonghuService;

@Service
public class TyonghuServiceImpl implements TyonghuService{

	@Autowired
	TyonghuRepository repository;

	@Override
	public Tyonghu save(Tyonghu entity) {
		// TODO Auto-generated method stub
		return repository.save(entity);
	}

	@Override
	public Tyonghu getById(Integer id) {
		// TODO Auto-generated method stub
		return repository.getById(id);
	}

	@Override
	public void update(Tyonghu dto) {
		// TODO Auto-generated method stub
		repository.save(dto);
	}

	@Override
	public Tyonghu login(Tyonghu ty) {
		// TODO Auto-generated method stub
		return repository.login(ty.getMobile(), ty.getPassword());
	}

	@Override
	public String getByPasswords(String mobile) {
		// TODO Auto-generated method stub
		return repository.getByPasswords(mobile);
	}

	@Override
	public Tyonghu getByYh(String mobile) {
		// TODO Auto-generated method stub
		return repository.getByYh(mobile);
	}
	 
}
